{extend name="public:base" /}
{block name="content"}


    <div style="width: 500px;height:auto; padding-top: 20px">

        <div id="from" class="layui-form"  >
            <input type="hidden" name="id" value="{$data.id}" id="id">

            <div class="layui-form-item">
                <label class="layui-form-label">用户昵称</label>
                <div class="layui-input-block">
                    <input type="text" name="nickname" value="{$data.nickname}" lay-verify="required" disabled="disabled" autocomplete="off" class="layui-input">
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">用户账号</label>
                <div class="layui-input-block">
                    <input type="text" name="account" value="{$data.account}" lay-verify="required" disabled="disabled" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">名字</label>
                <div class="layui-input-block">
                    <input type="text" name="" value="{$data.name}" lay-verify="required" disabled="disabled" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">手机号</label>
                <div class="layui-input-block">
                    <input type="text" name="" value="{$data.phone}" lay-verify="required" disabled="disabled" autocomplete="off" class="layui-input">
                </div>
            </div>
        
            <div class="layui-form-item">
                <label class="layui-form-label">商品</label>
                <div class="layui-input-block">
                    <input type="text" name="name" lay-verify="required" disabled="disabled" autocomplete="off" class="layui-input" value="{$data.name}">
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">订单地址</label>
                <div class="layui-input-block">
                    <textarea name="address" type="text/plain" disabled="disabled" class="layui-input" style="height:auto;width:390px">{$data.address}</textarea>
                </div>
            </div>


            <div class="layui-form-item">
                <label class="layui-form-label">物流公司</label>
                <div class="layui-input-block">
                    <input type="text" name="logistics" lay-verify="required" autocomplete="off" id="logistics" class="layui-input" value="">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">物流单号</label>
                <div class="layui-input-block">
                    <input type="text" name="logi_number" lay-verify="required" autocomplete="off" id="logi_number" class="layui-input" value="">
                </div>
            </div>

            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn" lay-submit lay-filter="formDemo" onclick="SubmitSend()">确认发货</button>
                    <!--<button type="submit" class="layui-btn" lay-filter="formDemo">立即提交</button>-->
                </div>
            </div>
        </div>

    </div>
{/block}

{block name="js"}
<script src="__JS__/fromCommon.js" charset="utf-8"></script>
<script src="__JS__/jquery-3.2.1.min.js" charset="utf-8"></script>
{/block}

{block name="javascript"}
<script type="text/javascript">


function SubmitSend(){
    var id = $("#id").val();
    var logistics = $("#logistics").val();
    var logi_number = $("#logi_number").val();
    if(logistics == ''){
        alert("请输入快递公司");
        return false;
    }
    if(logi_number == ''){
        alert("请输入快递单号");
        return false;
    }
    $.ajax({
        type: "POST",
        url: '{:url("Up_goods/edit")}',
        dataType:'json',
        data: {
            id:id,
            logistics:logistics,
            logi_number:logi_number
        },
        success: function (data) {
//            console.log(data);
            if( data.result == 0 ){
                alert(data.msg);
                window.location.href = '{:url("Up_goods/index")}';
            }else{
                alert(data.msg);
            }
        }

    });

}


</script>
{/block}